<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class ModifyImchat extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('imchat', function (Blueprint $table) {
            $table->dropColumn('send_channel');
            $table->dropColumn('receive_channel');
        });

        Schema::table('imchat_message_log', function (Blueprint $table) {
            $table->dropColumn('send_channel');
            $table->dropColumn('receive_channel');
            $table->string('send_user',32)->default('')->comment('发送消息用户，前缀 user 代表用户端，partner代表合作商，admin代表母公司平台');
            $table->string('receive_user', 32)->default('')->comment('接收消息用户，前缀 user 代表用户端，partner代表合作商，admin代表母公司平台');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('', function (Blueprint $table) {
            //
        });
    }
}
